According to an image compression method, such as moving picture expert group (MPEG)-1, MPEG-2, MPEG-4, or H.264/MPEG-4 advanced video coding (AVC), a picture is split into macroblocks in order to encode an image. After each of the macroblocks is encoded in any of inter prediction and intra prediction encoding modes, an appropriate encoding mode is selected according to a bit rate required for encoding each macroblock and an allowable distortion between an original macroblock and a decoded macroblock, and then each macroblock is encoded in the selected encoding mode.
As hardware for reproducing and storing high resolution or high quality video content is being developed and supplied, a need for a video codec for effectively encoding or decoding the high resolution or high quality video content is increasing. According to a conventional video codec, a video is encoded in a limited prediction mode based on a macroblock having a predetermined size.
In an intra prediction mode, a current block may be predicted by referring to neighboring reference pixels that are reconstructed earlier than the current block to be predicted. Since a difference between pixel values of the current block and a prediction block predicted by using intra prediction is represented as residual data, encoding efficiency and decoding efficiency may be improved.